package com.wf.mock.app.mina.app;

import java.util.concurrent.TimeUnit;

import org.apache.mina.core.future.ConnectFuture;
import org.apache.mina.core.service.IoConnector;
import org.apache.mina.core.session.IoSession;

import com.wf.mock.app.mina.ConnectorManager;
import com.wf.mock.app.mina.MessageIntentType;

public class MockPortalClient {

	public static void main(String[] args) throws InterruptedException {
		IoConnector connector = ConnectorManager.getAppConnector();
		ConnectFuture connectFuture = connector.connect();

		connectFuture.awaitUninterruptibly();

		IoSession session = connectFuture.getSession();
		session.write(MessageIntentType.PORTALCONNECT + "{}");

		while (true) {
			TimeUnit.SECONDS.sleep(30);
		}
	}

}
